package com.thermofisher.dsc.amanda.model.dto.customer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thermofisher.dsc.amanda.model.BaseModel;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;


@Setter
@Getter
public class ITSCARDto extends BaseModel {
    private String bill2NO;

    @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
    private Date billDate;

    @JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
    private Date expireDate;

    private String indentNO;

    private String billNO;

    @JsonIgnore
    private BigDecimal overdueAmount;

    private String overdueAmountStr;

    public String getOverdueAmountStr() {
        if (overdueAmount != null){
            DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
            return decimalFormat.format(overdueAmount);
        }
        return null;
    }
}
